<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  created () {
    /* 存储localStorage 的缓存内容 */
    if (localStorage.token) {
      this.$store.dispatch('webRefresh')
    }
  },
  name: 'app',
  computed: mapState({
    rule: state => state.rule
  }),
  watch: {
    rule: function (val, oldVal) {
      if (val !== 100) {
        this.$router.push({name: 'SignView'})
      }
    }
  }
}
</script>
<style>
#app {
  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;
}
a {
  text-decoration:none;
}
body, html {
  margin: 0;
  padding: 0;
  background: #e1e6f0;
  height: 100%;
}
</style>
